

UdkpRaid_RarityTable = {
	["ff9d9d9d"] = 0,
	["ffffffff"] = 1,
	["ff1eff00"] = 2,
	["ff0070dd"] = 3,
	["ffa335ee"] = 4,
	["ffff8000"] = 5,
};

function Uasit_UpdateItem()
	
	totalItems=0;
	if(TEST_PARTY_STUFF and getn(TEST_PARTY_STUFF) > 0) then
		totalItems = getn(TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"]);
	else
		for i=1, UDKP_NUM_BIDS_TO_DISPLAY  do
			getglobal("UdkpItemFrameListButton"..i):Hide();
		end
		FauxScrollFrame_Update(UdkpItemListScrollFrame,0 ,UDKP_NUM_BIDS_TO_DISPLAY,AUCTIONS_BUTTON_HEIGHT);
		return;
	end
	
	offset=0;
	local offset = FauxScrollFrame_GetOffset(UdkpItemListScrollFrame);
	Uasit_Debug("offset",offset);
	
	for i=1, UDKP_NUM_BIDS_TO_DISPLAY  do
		k = offset + i;
		if ( k > totalItems ) then
			getglobal("UdkpItemFrameListButton"..i):Hide();
		else
			getglobal("UdkpItemFrameListButton"..i):Show();
			item = TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"][k];

			if ( getglobal("UdkpItemFrameListButton" .. i) ) then

				getglobal("UdkpItemFrameListButton" .. i .. "itemid"):SetText(item["itemid"]);
				getglobal("UdkpItemFrameListButton" .. i .. "Name"):SetText("|c" .. item["c"]..item["name"]);
				c=item["c"];
				getglobal("UdkpItemFrameListButton" .. i .. "Rare"):SetText(string.sub(item["time"],10));
				getglobal("UdkpItemFrameListButton" .. i .. "Sdkp"):SetText(item["pcost"]);
				getglobal("UdkpItemFrameListButton" .. i .. "ToMember"):SetText(item["player"]);
				getglobal("UdkpItemFrameListButton" .. i .. "ItemDkp"):SetText(item["cost"]);
				--if ( item["type"] and UdkpRaid_lang_ItemTextures[item["type"]] ) then
				--getglobal("UdkpItemFrameListButton" .. i .. "ItemIcon"):SetTexture("Interface\\Icons\\"..UdkpRaid_lang_ItemTextures[item["type"]]);
				--else
				--	getglobal("UdkpItemFrameListButton" .. i .. "ItemIcon"):SetTexture("Interface\\Icons\\"..UdkpRaid_lang_ItemTextures["Other"]);
				--end
				--Uasit_Debug(item["type"]);
				getglobal("UdkpItemFrameListButton" .. i .. "ItemIcon"):SetTexture("Interface\\Icons\\"..item["type"]);
				--item["tooltip"]=Udkp_GetItemTooltip(item["id"])
				--local itemName, itemLink, itemQuality, itemLevel, itemType, itemSubType, itemCount, itemTexture = GetItemInfo("item:"..item["id"]);
				--Uasit_Debug("itemTexture1--------",itemTexture,itemLink,item["id"],itemName);
				--getglobal("UdkpItemFrameListButton" .. i .. "ItemIcon"):SetTexture(itemTexture);
			end
		end
	end
	local c0=0;
	local c1=0;
	local c2=0;
	local c3=0;
	local c4=0;
	local c5=0;
	for i=1, totalItems  do
				
				c=TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"][i]["c"];
				if(c=="ff9d9d9d") then
					c0=c0+1;
				elseif(c=="ffffffff") then
					c1=c1+1;
				elseif(c=="ff1eff00") then
					c2=c2+1;
				elseif(c=="ff0070dd") then
					c3=c3+1;
				elseif(c=="ffa335ee") then
					c4=c4+1;
				elseif(c=="ffff8000") then
					c5=c5+1;
				end
	end
	FauxScrollFrame_Update(UdkpItemListScrollFrame,totalItems ,UDKP_NUM_BIDS_TO_DISPLAY,AUCTIONS_BUTTON_HEIGHT);
	getglobal("UdkpRaidHeaderString"):SetText(UDKP_MESSAGE_ITEM.."|cff1eff00"..TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Notes"].."|r(|cffffffff"..totalItems.."|r:|cff9d9d9d"..c0.."|r/|cffffffff"..c1.."|r/|cff1eff00"..c2.."|r/|cff0070dd"..c3.."|r/|cffa335ee"..c4.."|r/|cffff8000"..c5.."|r)");
end

function Udkp_SetHyperlink()
	GameTooltip:SetOwner(this, "ANCHOR_RIGHT");
	local itemid = getglobal(this:GetName() .. "itemid"):GetText();
	lootid=1;
	itemnumber=getn(TEST_PARTY_STUFF[1]["Items"]);
	for i=1,itemnumber,1 do
		if(itemid==TEST_PARTY_STUFF[1]["Items"][i]["itemid"]) then
			lootid=i;
		end
	end
	if ( TEST_PARTY_STUFF[1] and TEST_PARTY_STUFF[1]["Items"][lootid] ) then
		local item = TEST_PARTY_STUFF[1]["Items"][lootid];
		--Uasit_Debug(itemid,item["id"]);
		if (GetItemInfo("item:" .. item["id"])) then
			GameTooltip:SetHyperlink("item:" .. item["id"]);
			--Uasit_Debug("GameTooltip:NumLines()",GameTooltip:NumLines());
		else
			rl, gl, bl = UdkpColorToRGB(item["c"]);
			GameTooltip:AddLine(item["name"], rl, gl, bl);
			GameTooltip:AddLine("This item is not in your cache, you can try to get the information by rightclicking the item (This may result in a disconnect!)", 1, 1, 1);
		end
	end

	GameTooltip:Show();
end

function UdkpDeleteItembyItemid(itemid)

	if(itemid=="") then
		return;
	end
	
	
	itemnumber=getn(TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"]);
	membernumber=getn(TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Members"]);
	eventnumber=getn(TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Events"]);
	for i=1,itemnumber,1 do
		if(itemid==TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"][i]["itemid"]) then
			if(TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"]["cost"]==0) then
				table.remove(TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"],i)
--				Uasit_UpdateItem();
			else
				for j=1,eventnumber,1 do
					if(itemid==TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Events"][j]["itemid"]) then
						table.remove(TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Events"],j);
						break;
					end
				end
				for j=1,membernumber,1 do
					if(TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"][i]["player"]==TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Members"][j]["player"]) then
						TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Members"][j]["dkp"]=TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Members"][j]["dkp"] +TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"][i]["cost"]
						TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Members"][j]["ldkp"]=TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Members"][j]["ldkp"] +TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"][i]["cost"]
						break;
					end
				end
				table.remove(TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"],i)
				Uasit_UpdateItem();
	--			Uasit_UpdateMember();
		--		Uasit_UpdateEvent();
			end
			break;
		end
	end
	
end

function UdkpChangeItemDkp(itemid)

	itemid=getglobal("currentitemid"):GetText();
	newitemdkp=getglobal("UdkpChangeItemPoint"):GetNumber();
	getglobal("UdkpChangeItemPoint"):SetText("");
		if(itemid=="") then
		return;
	end
	itemnumber=getn(TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"]);
	membernumber=getn(TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Members"]);
	if(membernumber<1) then
		UdkpRaidMessageBox(UDKP_MESSAGE_NO_MEMBER);
		return;
	end
	eventnumber=getn(TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Members"]);
	for i=1,itemnumber,1 do
		if(itemid==TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"][i]["itemid"]) then
			
			if(TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"][i]["cost"]==0 and newitemdkp==0) then
				return;
			end
			
			if(TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"][i]["cost"]==0) then
				
				TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"][i]["cost"]=0+newitemdkp;
				
				table.insert(TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Events"],1,
					{
						["eventid"] = UdkpGenId(),
						["itemid"] = itemid,
						["itemname"] = TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"][i]["name"],
						["reason"] = UDKP_STRING_ITEM_GET..TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"][i]["name"],
						["type"] = 3,
						["eventtime"] = Udkp_Date(),
						["dkp"] =0 - newitemdkp,
						["players"]={TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"][i]["player"]}
					}
				);
				for j=1,membernumber,1 do
				if(TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"][i]["player"]==TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Members"][j]["player"]) then
					TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Members"][j]["dkp"]=TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Members"][j]["dkp"] - newitemdkp
					
					break;
					end
				end		
				Uasit_UpdateItem();
--				Uasit_UpdateMember();
--				Uasit_UpdateEvent();
			else
				for j=1,eventnumber,1 do
					if(itemid==TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Events"][j]["itemid"]) then
						TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Events"][j]["dkp"]=0 - newitemdkp
						break;
					end
				end
				for j=1,membernumber,1 do
					if(TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"][i]["player"]==TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Members"][j]["player"]) then
						TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Members"][j]["dkp"]=TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Members"][j]["dkp"] +TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"][i]["cost"] - newitemdkp
						TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Members"][j]["ldkp"]=TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Members"][j]["ldkp"] +TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"][i]["cost"]- newitemdkp
						break;
					end
				end
				TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"][i]["cost"]=newitemdkp;
				Uasit_UpdateItem();
--				Uasit_UpdateMember();
--				Uasit_UpdateEvent();
			end
			break;
		end
	end
	
end

function UdkpChangeItemMember()

	itemid=getglobal("currentitemid"):GetText();
	if(itemid=="") then
		return;
	end
	totalItems = getn(TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"]);
	totalraidmembers=getn(TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Members"]);
	if(totalraidmembers<1) then
		UdkpRaidMessageBox(UDKP_MESSAGE_NO_MEMBER);
		return;
	end
	totalevents=getn(TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Events"]);
	for i =1 ,totalItems,1 do
		item=TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"][i];
		if(item["itemid"]==itemid) then
			for j=1,60,1 do
			
				if(getglobal("UdkpItemMemberList"..j.."Check"):GetChecked()) then
					for k=1,totalraidmembers,1 do
						if(item["player"]==TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Members"][k]["player"]) then
							TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Members"][k]["dkp"]=TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Members"][k]["dkp"]+item["cost"];
							
						end
						if(getglobal("UdkpItemMemberList"..j.."ButtonName"):GetText()==TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Members"][k]["player"]) then
							TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Members"][k]["dkp"]=TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Members"][k]["dkp"]-item["cost"];
							
						end
					end
					
					for k=1,totalevents,1 do
						if(TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Events"][k]["itemid"]==itemid) then
							TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Events"][k]["players"][1]=getglobal("UdkpItemMemberList"..j.."ButtonName"):GetText();
						end
					end
					
					item["player"]=getglobal("UdkpItemMemberList"..j.."ButtonName"):GetText();
					break;
				end
			end
			
			break;
		end
	end
	UdkpChangeItemMemberFrame:Hide();
--	Uasit_UpdateMember();
--	Uasit_UpdateEvent();
	Uasit_UpdateItem();

end

function UdkpChangeItemMemberFrame_OnMouseUp()

	if ( UdkpChangeItemMemberFrame.isMoving ) then
		UdkpChangeItemMemberFrame:StopMovingOrSizing();
		UdkpChangeItemMemberFrame.isMoving = false;
	end
end

function UdkpChangeItemMemberFrame_OnMouseDown(button)
	if ( ( ( not UdkpChangeItemMemberFrame.isLocked ) or ( UdkpChangeItemMemberFrame.isLocked == 0 ) ) and ( arg1 == "LeftButton" ) ) then
		UdkpChangeItemMemberFrame:StartMoving();
		UdkpChangeItemMemberFrame.isMoving = true;
	end
end



function UdkpChangeItemMemberFrame_OnHide()
	if ( UdkpChangeItemMemberFrame.isMoving ) then
		UdkpChangeItemMemberFrame:StopMovingOrSizing();
		UdkpChangeItemMemberFrame.isMoving = false;
	end
end

function UdkpChangeItemMemberFrame_OnShow()
	itemid=getglobal("currentitemid"):GetText();
	if(itemid=="") then
		return;
	end

	totalItems = getn(TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"]);
	totalraidmembers=getn(TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Members"]);
	Uasit_Debug(totalItems,totalraidmembers);
	for i =1 ,totalItems,1 do
		item=TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"][i];
		if(item["itemid"]==itemid) then
			
			for j=1,60,1 do
				if(j>totalraidmembers) then
					getglobal("UdkpItemMemberList"..j):Hide();
					getglobal("UdkpItemMemberList"..j.."Check"):SetChecked(false);
				else
					getglobal("UdkpItemMemberList"..j):Show();
					if(item["player"]==TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Members"][j]["player"]) then
						getglobal("UdkpItemMemberList"..j.."Check"):SetChecked(true);
					else
						getglobal("UdkpItemMemberList"..j.."Check"):SetChecked(false);
					end
					
					getglobal("UdkpItemMemberList"..j.."ButtonName"):SetText(TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Members"][j]["player"]);
				end
			end
			break;
		end
	end
end

function UdkpItemMemberListTemplate_OnClick(index)
	for i=1,60,1 do
		if(index~=i) then
			getglobal("UdkpItemMemberList"..i.."Check"):SetChecked(false);
		else
			getglobal("UdkpItemMemberList"..i.."Check"):SetChecked(true);
		end
	end
end

function Udkp_CompareItems(a1, a2)

	local  method, way = Udkp_SortOptions["method"], Udkp_SortOptions["itemway"];

	if ( method == "player" ) then
		local c1, c2 = a1["player"], a2["player"];
		if ( way == "asc" ) then
			return c1 < c2;
		else
			return c1 > c2;
		end
	elseif ( method == "rare" ) then
		local c1, c2 = UdkpRaid_RarityTable[a1["c"]], UdkpRaid_RarityTable[a2["c"]];
		if ( way == "asc" ) then
			return c1 < c2;
		else
			return c1 > c2;
		end
	elseif ( method == "name" ) then
		local c1, c2 = a1["c"], a2["c"];
		if ( way == "asc" ) then
			return c1 < c2;
		else
			return c1 > c2;
		end
	elseif ( method == "time" ) then
		local c1, c2 = a1["name"], a2["time"];
		if ( way == "asc" ) then
			return c1 < c2;
		else
			return c1 > c2;
		end
	elseif ( method == "cost" ) then
		local c1, c2 = a1["cost"], a2["cost"];
		if ( way == "asc" ) then
			return c1 < c2;
		else
			return c1 > c2;
		end
	end
end


function Udkp_SortItem(maps)

		table.sort(
			maps,
			Udkp_CompareItems
		);

end

function UdkpSortOptions_ToggleItem(method)

	if ( Udkp_SortOptions.method and Udkp_SortOptions.method == method ) then
		if ( Udkp_SortOptions.itemway and Udkp_SortOptions.itemway == "asc" ) then
			Udkp_SortOptions.itemway = "desc";
		else
			Udkp_SortOptions.itemway = "asc";
		end
	else
		Udkp_SortOptions.method = method;
		Udkp_SortOptions.itemway = "asc";
	end
	Udkp_SortItem(TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"]);
	Uasit_UpdateItem();
end

function UdkpColorToRGB(str)
	Uasit_Debug("colorToRGB", str);
	str = strlower(strsub(str, 3));
	local tbl = { };
	tbl[1], tbl[2], tbl[3], tbl[4], tbl[5], tbl[6] = strsub(str, 1, 1), strsub(str, 2, 2), strsub(str, 3, 3), strsub(str, 4, 4), strsub(str, 5, 5), strsub(str, 6, 6);
	
	local highvals = { ["a"] = 10, ["b"] = 11, ["c"] = 12, ["d"] = 13, ["e"] = 14, ["f"] = 15 };
	for k, v in tbl do
		if ( highvals[v] ) then
			tbl[k] = highvals[v];
		elseif ( tonumber(v) ) then
			tbl[k] = tonumber(v);
		end
	end
	local r, g, b = (tbl[1]*16+tbl[2])/255, (tbl[3]*16+tbl[4])/255, (tbl[5]*16+tbl[6])/255;
	if ( not r or r > 1 or r < 0 ) then
		r = 1;
	end
	if ( not g or g > 1 or g < 0 ) then
		g = 1;
	end
	if ( not b or b > 1 or b < 0 ) then
		b = 1;
	end
	return r, g, b;
end

function UdkpGetColorString(str)
	local playerClass = UnitClass("player");
	local playerLevel = UnitLevel("player");
	local classArmor = UdkpRaid_lang_classArmor;
	
	if(not str) then
		return 0, 1, 0;
	end
	
	-- Equip:
	if ( string.find(str, "^"..UdkpRaid_lang_Equip..": ") ) then
		return 0, 1, 0;
		
	-- Use:
	elseif ( string.find(str, "^"..UdkpRaid_lang_Use..": ") ) then
		return 0, 1, 0;
		
	-- Chance on hit:
	elseif ( string.find(str, "^"..UdkpRaid_lang_Chanceonhit..":") ) then
		return 0, 1, 0;
		
	-- Sets
	elseif ( string.find(str, "^.+ %(%d+/%d+%)$") ) then
		return 1, 0.82, 0, 1;
	
	-- Durability 0/X
	elseif ( string.find(str, "^"..UdkpRaid_lang_Durability.." 0 / %d+$") ) then
		return 1, 0.15, 0.15;
		
	-- Wrong class
	elseif ( string.find(str, "^"..UdkpRaid_lang_Classes..": ") and not string.find(str, "^"..UdkpRaid_lang_Classes..": .*" .. playerClass) ) then
		return 1, 0.15, 0.15;
		
	-- Made by
	elseif ( string.find(str, "^<"..UdkpRaid_lang_Madeby.." .+>$") ) then
		return 0, 1, 0;
	end	
	
	
	
	-- Armor type
	Uasit_Debug(classArmor[playerClass][str],playerLevel);
	if ( classArmor[playerClass][str] and classArmor[playerClass][str] > playerLevel ) then
		return 1, 0.15, 0.15;
	end
	
	-- Low level
	--local iStart, iEnd, level = string.find(str, "^Requires Level (%d+)$");
	local iStart, iEnd, level = string.find(str, "^"..UdkpRaid_lang_RequiresLevel.." (%d+)$");
	if ( level and tonumber(level) > playerLevel ) then
		return 1, 0.15, 0.15;
	end
	return 1, 1, 1;
end

function UdkpDeleteitem()
				if(getglobal("UDKP_AcceptDeleteFrametype"):GetText()=="1") then
					getglobal("UDKP_AcceptDeleteFrameHeaderText"):SetText(UDKP_BUTTON_MEMBER_DELETE);
					getglobal("UDKP_AcceptDeleteFrameInfo"):SetText(UDKP_MESSAGE_MEMBER_DELETE);
				elseif(getglobal("UDKP_AcceptDeleteFrametype"):GetText()=="2") then
					getglobal("UDKP_AcceptDeleteFrameHeaderText"):SetText(UDKP_BUTTON_ITEM_DELETE);
					getglobal("UDKP_AcceptDeleteFrameInfo"):SetText(UDKP_MESSAGE_ITEM_DELETE);
				elseif(getglobal("UDKP_AcceptDeleteFrametype"):GetText()=="3") then
					getglobal("UDKP_AcceptDeleteFrameHeaderText"):SetText(UDKP_BUTTON_EVENT_DELETE);
					getglobal("UDKP_AcceptDeleteFrameInfo"):SetText(UDKP_MESSAGE_EVENT_DELETE);
				elseif(getglobal("UDKP_AcceptDeleteFrametype"):GetText()=="4") then
					getglobal("UDKP_AcceptDeleteFrameHeaderText"):SetText(UDKP_BUTTON_RAID_DELETE);
					getglobal("UDKP_AcceptDeleteFrameInfo"):SetText(UDKP_MESSAGE_RAID_DELETE);
				end
end

function SendItemList()

	
	if(TEST_PARTY_STUFF and getn(TEST_PARTY_STUFF) > 0) then
	
		SendChatMessage("=="..TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Notes"]..UDKP_MESSAGE_ITEM_LIST.."==",UdkpOptions.UdkpChannelLevel, this.language, nil);
	
		totalItems = getn(TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"]);
		dkptotal=0;
		for i=1,totalItems do
			local item=TEST_PARTY_STUFF[UdkpRaid_GetCurrentRaid]["Items"][i]
			if(UdkpRaid_RarityTable[item["c"]]>-1) then
				SendChatMessage("|c"..item["c"].."|Hitem:"..item["id"].."|h["..item["name"].."]|h|r,"..item["player"]..","..item["cost"],UdkpOptions.UdkpChannelLevel, this.language, nil);
				dkptotal=dkptotal+item["cost"];
			end
		end
		
	--FauxScrollFrame_Update(UdkpItemListScrollFrame,totalItems ,UDKP_NUM_BIDS_TO_DISPLAY,AUCTIONS_BUTTON_HEIGHT);
--	getglobal("UdkpRaidHeaderString"):SetText(UDKP_MESSAGE_ITEM.."|cff0070dd"..c3.."|r/|cffa335ee"..c4.."|r/|cffff8000"..c5.."|r)");
	--	SendChatMessage(UDKP_MESSAGE_ITEM.."|cff1eff00"..c2.."|r/|cff0070dd"..c3.."|r/|cffa335ee"..c4.."|r/|cffff8000"..c5.."|r)",UdkpOptions.UdkpChannelLevel, this.language, nil);
		SendChatMessage(UDKP_MESSAGE_DKP_TOTAL..dkptotal,UdkpOptions.UdkpChannelLevel, this.language, nil);
	end
end